<?php
namespace Admin\Controller;
use Think\Controller;
class OrderController extends BaseController {
   public function classorderList(){
        $orderModel=M('order');
        $club_id=S('club_id');
		$order=$orderModel->where("order_role=0")->order('order_sid desc')->join("user on order.user_id=user.user_id")->join("club_lesson on order.order_sid=club_lesson.club_lesson_id")->select(); //查询
		$this->order=$order; //volist name
		$this->display();
}
 public function trainorderList(){
       $orderModel=M('order');
       $club_id=S('club_id');
        $order=$orderModel->where("order_role=1")->order('order_sid desc')->join("user on order.user_id=user.user_id")->join("train on order.order_sid=train.tr_id")->select(); //查询
        $this->order=$order; //volist name
        $this->display();
}
public function delclassorder(){
    $orderModel=M('order');
        $order_id=$_GET['id'];
        if ($orderModel->where("order_id=$order_id")->delete()) {
            $this->success('删除成功');
        }else{
            $this->error('删除失败');
        }
}
public function deltrainorder(){
    $orderModel=M('order');
        $order_id=$_GET['id'];
        if ($orderModel->where("order_id=$order_id")->delete()) {
            $this->success('删除成功');
        }else{
            $this->error('删除失败');
        }
}
}